package a3;

public class Instructor {
    private String name;
    private Subject[] taughtSubjects;
    private int subjectCount;

    public Instructor(String name) {
        this.name = name;
        this.taughtSubjects = new Subject[3]; // 假设每个教师最多教3门课
        this.subjectCount = 0;
    }

    public void addTaughtSubject(Subject subject) {
        if (subjectCount < 3) {
            taughtSubjects[subjectCount++] = subject;
        }
    }
}
